Skip to content

Conversation

@jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented Feb 9, 2026

Summary by CodeRabbit

  • Refactor
    • Internal improvements to task scheduling logic with no external behavior changes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The changes introduce two helper functions (_refresh_memory_dict and _cancel_processes) that consolidate repeated logic in the task scheduler's execute_tasks_h5 function. A test utility function is added for long-running test scenarios.

Changes

Cohort / File(s) Summary
Task scheduler refactoring
src/executorlib/task_scheduler/file/shared.py
Extracted _refresh_memory_dict() and _cancel_processes() helper functions to consolidate dictionary refresh and process termination logic previously inline in execute_tasks_h5, centralizing control flow without altering external behavior.
Test utilities
tests/unit/executor/test_flux_cluster.py
Added long_running_function() test helper that sleeps for 10 seconds to support long-running test scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 With helpers refined and logic made neat,
Process management skips and dances complete,
Memory dances, cancellations take flight,
Tests run long and steady through the night!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refresh_memory_dict

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jan-janssen jan-janssen marked this pull request as draft February 9, 2026 19:00
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

 ___________________________________
< Tom & Jerry level of bug chasing. >
 -----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

✏️ Tip: You can disable in-progress messages and the fortune message in your review settings.

Tip

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refresh_memory_dict

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

A helper function _refresh_memory_dict() was introduced to consolidate repeated inline memory dictionary refresh logic that appeared across three code paths. Previously, each location used dict comprehensions calling _check_task_output; now all three invoke the new centralized helper, eliminating duplication while maintaining identical behavior.

Changes

Cohort / File(s) Summary
Memory Dictionary Refresh Refactoring
src/executorlib/task_scheduler/file/shared.py
Extracted repeated inline dict comprehension logic into new _refresh_memory_dict() helper function. Helper is invoked in three previously duplicated code paths that refresh memory dictionaries by filtering completed futures. Semantic behavior unchanged; logic consolidated for maintainability.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Three paths became one, the code whispered with glee,
No more repetition, just helpers so free,
Memory dicts refresh with elegance bright,
Refactored and tidy, everything right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing a new helper function _refresh_memory_dict() to consolidate repeated logic, which is the primary objective of this refactoring PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refresh_memory_dict

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/executorlib/task_scheduler/file/shared.py (1)

265-274: Good DRY refactor consolidating the repeated dict comprehension.

The extraction is clean and the behavior is preserved. One optional suggestion: add a brief docstring for consistency with the other private helpers in this file (e.g., _check_task_output, _convert_args_and_kwargs).

📝 Optional: add docstring
 def _refresh_memory_dict(memory_dict: dict, cache_dir_dict: dict) -> dict:
+    """
+    Refresh memory_dict by checking task outputs and removing completed futures.
+
+    Args:
+        memory_dict (dict): Mapping of task keys to their associated future objects.
+        cache_dir_dict (dict): Mapping of task keys to their cache directories.
+
+    Returns:
+        dict: Updated memory_dict with only pending (not done) futures.
+    """
     return {
         key: _check_task_output(

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.61%. Comparing base (7e68730) to head (44ff716).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #902      +/-   ##
==========================================
+ Coverage   93.60%   93.61%   +0.01%     
==========================================
  Files          38       38              
  Lines        1891     1895       +4     
==========================================
+ Hits         1770     1774       +4     
  Misses        121      121              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jan-janssen jan-janssen marked this pull request as ready for review February 13, 2026 06:35
@jan-janssen jan-janssen merged commit aa0f602 into main Feb 13, 2026
87 of 91 checks passed
@jan-janssen jan-janssen deleted the refresh_memory_dict branch February 13, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants